package com.jrowny.commands
{
	import com.jrowny.mediators.AppMediator;
	import com.jrowny.mediators.ElementsGridMediator;
	import com.jrowny.mediators.ImageAreaMediator;
	import com.jrowny.mediators.PreferencesMediator;
	import com.jrowny.mediators.PreviewAreaMediator;
	import com.jrowny.proxy.ElementProxy;
	import com.jrowny.proxy.FileProxy;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	import spark.components.Application;
	
	public class StartupCommand extends SimpleCommand
	{
		override public function execute(notification:INotification):void{
			var app:SpriteHero = notification.getBody() as SpriteHero;
			
			//register our proxies
			facade.registerProxy(new ElementProxy());
			facade.registerProxy(new FileProxy());
			
			//register our mediators
			facade.registerMediator(new AppMediator(app));
			facade.registerMediator(new ElementsGridMediator(app.elementsGrid));
			facade.registerMediator(new PreviewAreaMediator(app.previewArea));
			facade.registerMediator(new ImageAreaMediator(app.imageArea));
			facade.registerMediator(new PreferencesMediator(app.preferences));
		}
	}
}